package com.lagou.service.impl;

import com.lagou.service.HelloService;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.zookeeper.common.Time;

import java.util.Random;


public class HelloServiceAImpl implements HelloService {

    @Override
    public String methodA(String name) {
        try {
            Thread.sleep(random());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodA";
    }

    @Override
    public String methodB(String name) {
        try {
            Thread.sleep(random());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodB";
    }

    @Override
    public String methodC(String name) {
        try {
            Thread.sleep(random());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodC";
    }

    private int random(){
        return new Random().nextInt(100);
    }
}
